#pragma once
#include "DJoint.h"

namespace Skill
{
	namespace Ode
	{
		ref class DWorld;
		ref class DVector3;
		namespace Joints
		{
			ref class DJointGroup;

			public ref class DBall : DJoint
			{
			protected:
				virtual void CollectManagedMemory() override;
			public:							
				///<summary>
				/// Create a new joint of the ball type.
				///</summary>
				///<param name = "world"> Wrold </param>
				///<param name = "group">
				/// set to null to allocate the joint normally.
				/// If it is valid the joint is allocated in the given joint group.
				///</param>
				///<remarks>
				/// The joint is initially in "limbo" (i.e. it has no effect on the simulation)
				/// because it does not connect to any bodies.
				///</remarks>
				DBall(DWorld^ world , DJointGroup^ group);			

				///<summary>
				/// Gets or set  the joint anchor point in world coordinates.						
				/// The joint will try to keep this point on each body
				/// together. The input is specified in world coordinates.
				/// This returns the point on body 1. If the joint is perfectly satisfied,
				/// this will be the same as the point on body 2.
				///</summary>
				REF_PROP_DECLARATION_GETSET(DVector3,Anchor1);

				///<summary>
				/// Gets or set the joint anchor2 point in world coordinates.
				/// This returns the point on body 2. You can think of a ball and socket
				/// joint as trying to keep the result of dJointGetBallAnchor() and
				/// dJointGetBallAnchor2() the same.  If the joint is perfectly satisfied,
				/// this function will return the same value as dJointGetBallAnchor() to
				/// within roundoff errors. dJointGetBallAnchor2() can be used, along with
				/// dJointGetBallAnchor(), to see how far the joint has come apart.
				///</summary>
				REF_PROP_DECLARATION_GETSET(DVector3,Anchor2);

				///<summary>
				/// set joint parameter
				///</summary>
				void SetParam(DJointParameters parameter, dReal value);	

				///<summary>
				/// Get joint parameter
				///</summary>
				dReal GetParam(DJointParameters parameter);	

			};
		}
	}
}